<?php
     
	namespace Dashboard\Controller;
    class IndexController extends BaseController{
		public function index(){
		    //总人数
            $count = M("users")->count();
            if(!$count){
                $count = 0;
            }
            $this->assign("count",$count);
//            if($count){
//                //已毕业 未毕业 人数
//                $wei = M("users")->where("bi_ye = 1")->count();
//                $yi  = M("users")->where("bi_ye = 2")->count();
//                $wei_lv  = sprintf("%.2f",(($wei/$count)*100));
//                $yi_lv   = sprintf("%.2f",(($yi/$count)*100));
//                $this->assign("wei",$wei)->assign("yi",$yi);
//                //男女人数
//                $boy       = M("users")->where("sex = 1")->count();
//                $gril      = M("users")->where("sex = 2")->count();
//                $wei_zhi   = M("users")->where("sex = 0")->count();
//
//                $y     = ceil($count/5);
//                $boy_bi  = sprintf("%.2f",(($boy/$count)*100));
//                $gril_bi = sprintf("%.2f",(($gril/$count)*100));
//                $wei_bi  = sprintf("%.2f",(($wei_zhi/$count)*100));
//                $this->assign("boy",$boy)->assign("gril",$gril)->assign("wei_zhi",$wei_zhi)
//                     ->assign("boy_bi",$boy_bi)->assign("gril_bi",$gril_bi)->assign("wei_bi",$wei_bi);
//                //时时动态信息
//                $time = strtotime(date("Y-m-d",time()));
//                $evers = sel("evers","nums","create_at >= {$time}");
//                if(!$evers){
//                    $evers = 0;
//                }
//                $this->assign("evers",$evers);
//                //预约用户
//                $yu_count  = M("yue")->count();
//                if(!$yu_count){
//                    $yu_count = 0;
//                }
//                $this->assign("yue_count",$yu_count);
//                $one       = M("yue")->where("type_id = 1")->count();$two       = M("yue")->where("type_id = 2")->count();$three     = M("yue")->where("type_id = 3")->count();
//                $four      = M("yue")->where("type_id = 4")->count();$five      = M("yue")->where("type_id = 5")->count();$six       = M("yue")->where("type_id = 6")->count();
//                $seven     = M("yue")->where("type_id = 7")->count();$eight     = M("yue")->where("type_id = 8")->count();$nine      = M("yue")->where("type_id = 9")->count();
//                $ten       = M("yue")->where("type_id = 10")->count();$ones      = M("yue")->where("type_id = 11")->count();$twos      = M("yue")->where("type_id = 12")->count();
//                $threes    = M("yue")->where("type_id = 13")->count();
//                $one_bi    = sprintf("%.2f",(($one/$yu_count)*100));$two_bi    = sprintf("%.2f",(($two/$yu_count)*100));$three_bi  = sprintf("%.2f",(($three/$yu_count)*100));
//                $four_bi   = sprintf("%.2f",(($four/$yu_count)*100));$five_bi   = sprintf("%.2f",(($five/$yu_count)*100));$six_bi    = sprintf("%.2f",(($six/$yu_count)*100));
//                $seven_bi  = sprintf("%.2f",(($seven/$yu_count)*100));$eight_bi  = sprintf("%.2f",(($eight/$yu_count)*100));$nine_bi   = sprintf("%.2f",(($nine/$yu_count)*100));
//                $ten_bi    = sprintf("%.2f",(($ten/$yu_count)*100));$ones_bi   = sprintf("%.2f",(($ones/$yu_count)*100));$twos_bi   = sprintf("%.2f",(($twos/$yu_count)*100));
//                $threes_bi = sprintf("%.2f",(($threes/$yu_count)*100));
//                $this->assign("one",$one)->assign("two",$two)->assign("three",$three)->assign("four",$four)->assign("five",$five)
//                    ->assign("six",$six)->assign("seven",$seven)->assign("eight",$eight)->assign("nine",$nine)->assign("ten",$ten)
//                    ->assign("ones",$ones)->assign("twos",$twos)->assign("threes",$threes);
//                $this->assign("one_bi",$one_bi)->assign("two_bi",$two_bi)->assign("three_bi",$three_bi)->assign("four_bi",$four_bi)
//                    ->assign("five_bi",$five_bi)->assign("six_bi",$six_bi)->assign("seven_bi",$seven_bi)->assign("eight_bi",$eight_bi)
//                    ->assign("nine_bi",$nine_bi)->assign("ten_bi",$ten_bi)->assign("ones_bi",$ones_bi)->assign("twos_bi",$twos_bi)->assign("threes_bi",$threes_bi);
//                //地区分布
//                 /*'云南''辽宁' '黑龙江' '湖南''安徽' '山东' '新疆''北京' '上海' '天津''重庆' '河北' '河南'
//                '江苏''浙江''江西' '湖北' '广西' '甘肃' '山西' '内蒙古' '吉林' '福建''贵州' '广东''青海'
//                '西藏''四川''宁夏' '海南''台湾' '香港'澳门,陕西*/
//                //陕西
//                /*$shanxi       = M("user")->where("province = 1")->count();$beijing      = M("user")->where("province = 2")->count();
//                $hubei        = M("user")->where("province = 3")->count();$yunnan       = M("user")->where("province = 4")->count();
//                $liaoning     = M("user")->where("province = 5")->count();$heilongjiang = M("user")->where("province = 6")->count();
//                $hunan        = M("user")->where("province = 1")->count();$anhui        = M("user")->where("province = 1")->count();
//                $shandong     = M("user")->where("province = 1")->count();$xinjiang     = M("user")->where("province = 1")->count();
//                $shanghai     = M("user")->where("province = 1")->count();$tianjin      = M("user")->where("province = 1")->count();
//                $chongqing    = M("user")->where("province = 1")->count();$hebei        = M("user")->where("province = 1")->count();
//                $jiangsu      = M("user")->where("province = 1")->count();$zhejiang     = M("user")->where("province = 1")->count();
//                $jiangxi      = M("user")->where("province = 1")->count();$guangxi      = M("user")->where("province = 1")->count();
//                $gansu        = M("user")->where("province = 1")->count();$shanxis      = M("user")->where("province = 1")->count();//山西
//                $neimenggu    = M("user")->where("province = 1")->count();$jilin        = M("user")->where("province = 1")->count();
//                $fujian       = M("user")->where("province = 1")->count();$guizhou      = M("user")->where("province = 1")->count();
//                $guangdong    = M("user")->where("province = 1")->count();$qinghai      = M("user")->where("province = 1")->count();
//                $xizang       = M("user")->where("province = 1")->count();$sichuan      = M("user")->where("province = 1")->count();
//                $ningxia      = M("user")->where("province = 1")->count();$hainan       = M("user")->where("province = 1")->count();
//                $taiwan       = M("user")->where("province = 1")->count();$xianggang    = M("user")->where("province = 1")->count();
//                $aomen        = M("user")->where("province = 1")->count();$henan        = M("user")->where("province = 1")->count();*/
//                $shanxi       = M("user")->where("province = '陕西'")->count();$beijing      = M("user")->where("province = '北京'")->count();
//                $hubei        = M("user")->where("province = '湖北'")->count();$yunnan       = M("user")->where("province = '云南'")->count();
//                $liaoning     = M("user")->where("province = '辽宁'")->count();$heilongjiang = M("user")->where("province = '黑龙江'")->count();
//                $hunan        = M("user")->where("province = '湖南'")->count();$anhui        = M("user")->where("province = '安徽'")->count();
//                $shandong     = M("user")->where("province = '山东'")->count();$xinjiang     = M("user")->where("province = '新疆'")->count();
//                $shanghai     = M("user")->where("province = '上海'")->count();$tianjin      = M("user")->where("province = '天津'")->count();
//                $chongqing    = M("user")->where("province = '重庆'")->count();$hebei        = M("user")->where("province = '河北'")->count();
//                $jiangsu      = M("user")->where("province = '江苏'")->count();$zhejiang     = M("user")->where("province = '浙江'")->count();
//                $jiangxi      = M("user")->where("province = '江西'")->count();$guangxi      = M("user")->where("province = '广西'")->count();
//                $gansu        = M("user")->where("province = '甘肃'")->count();$shanxis      = M("user")->where("province = '山西'")->count();//山西
//                $neimenggu    = M("user")->where("province = '内蒙古'")->count();$jilin        = M("user")->where("province = '吉林'")->count();
//                $fujian       = M("user")->where("province = '福建'")->count();$guizhou      = M("user")->where("province = '贵州'")->count();
//                $guangdong    = M("user")->where("province = '广东'")->count();$qinghai      = M("user")->where("province = '青海'")->count();
//                $xizang       = M("user")->where("province = '西藏'")->count();$sichuan      = M("user")->where("province = '四川'")->count();
//                $ningxia      = M("user")->where("province = '宁夏'")->count();$hainan       = M("user")->where("province = '海南'")->count();
//                $taiwan       = M("user")->where("province = '台湾'")->count();$xianggang    = M("user")->where("province = '香港'")->count();
//                $aomen        = M("user")->where("province = '澳门'")->count();$henan        = M("user")->where("province = '河南'")->count();
//                $this->assign("shanxi",$shanxi)->assign("hubei",$hubei)->assign("liaoning",$liaoning)->assign("hunan",$hunan)->assign("shandong",$shandong)
//                    ->assign("shanghai",$shanghai)->assign("chongqing",$chongqing)->assign("jiangsu",$jiangsu)->assign("jiangxi",$jiangxi)->assign("gansu",$gansu)
//                    ->assign("neimenggu",$neimenggu)->assign("fujian",$fujian)->assign("guangdong",$guangdong)->assign("xizang",$xizang)->assign("ningxia",$ningxia)
//                    ->assign("taiwan",$taiwan)->assign("aomen",$aomen)->assign("beijing",$beijing)->assign("yunnan",$yunnan)->assign("heilongjiang",$heilongjiang)
//                    ->assign("anhui",$anhui)->assign("xinjiang",$xinjiang)->assign("tianjin",$tianjin)->assign("hebei",$hebei)->assign("zhejiang",$zhejiang)
//                    ->assign("guangxi",$guangxi)->assign("shanxis",$shanxis)->assign("jilin",$jilin)->assign("guizhou",$guizhou)->assign("qinghai",$qinghai)
//                    ->assign("sichuan",$sichuan)->assign("hainan",$hainan)->assign("xianggang",$xianggang)->assign("henan",$henan);
//            }
			$this->display();
		}
		public function evers(){
            $time = strtotime(date("Y-m-d",time()));
            $evers = sel("evers","nums","create_at >= {$time}");
            $this->ajaxReturn($evers['nums']);
        }
	}